{% set vuln_id = vulnerability_details.id %}
{% set vuln_view = vulnerability_details.vulnerability_view %}
{% set tree_url = vulnerability_details.tree_url %}
{% set master_commit = vuln_view.master_commit %}
{% set commit_hash = master_commit.commit_hash %}
{% if vuln_view.annotated %}
  <a href="{{ url_for('vuln.vuln_view', vuln_id=vuln_id) }}">Goto simplified view</a>
{% endif %}

<p class="h4 d-inline mb-0">
  <strong class="mb-2 text-dark d-inline">
    <a class="d-inline" href="{{ master_commit.repo_url }}" target="_blank">{{ master_commit.repo_name }}</a>
  </strong>
  - <small>Tree: <a href="{{ tree_url }}" target="_blank">{{ commit_hash[:10] }}</a></small>
</p>
<p class="d-inline">(<span id="num_files">?</span> files)</p>

<div class="mb-1 text-muted">Filter Settings</div>
<div class="jstree-settings">
  <div class="form-check">
    <input type="radio" class="form-check-input" name="jstree_filter" id="jstree_filter_all">
    <label class="form-check-label" for="jstree_filter_all">All Files</label>
  </div>
  <div class="form-check">
    <input type="radio" class="form-check-input" name="jstree_filter" id="jstree_filter_relevant" checked>
    <label class="form-check-label" for="jstree_filter_relevant">Relevant Files</label>
  </div>
  <div class="form-check">
    <input type="radio" class="form-check-input" name="jstree_filter" id="jstree_filter_vulnerable">
    <label class="form-check-label" for="jstree_filter_vulnerable">Vulnerable Files</label>
  </div>
  <div class="form-check">
    <input type="radio" class="form-check-input" name="jstree_filter" id="jstree_filter_patched">
    <label class="form-check-label" for="jstree_filter_patched">Patched Files</label>
  </div>
</div>
<div class="table-responsive">
  <div class="mb-1 text-muted">Files</div>
  <div id="files"></div>
</div>
